package service.impl;

import bean.Product;
import dao.IProductDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import service.IProductService;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional
public class ProductServiceImpl implements IProductService {
    @Resource
    private IProductDao iProductDao;

    @Override
    public List<Product> queryAll() {
        return iProductDao.queryAll();
    }

    @Override
    public Product queryById(Integer pid) {
        return iProductDao.queryById(pid);
    }

    @Override
    public void add(Product product) {
        iProductDao.add(product);
    }

    @Override
    public void update(Product product) {

        iProductDao.update(product);
    }

    @Override
    public void delete(Product product) {
        iProductDao.delete(product);
    }
}
